local hx__guanjun = fk.CreateSkill {
  name = "hx__guanjun",
}


hx__guanjun:addEffect(fk.CardUsing, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(hx__guanjun.name) and not data.card.is_damage_card
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(2, self.name)
    for _, p in ipairs(player.room.alive_players) do
      if p:getMark("@@hx__guanjun-turn") == 0 then
        room:addPlayerMark(p, "@@hx__guanjun-turn", 1)
      end
    end
  end
})

hx__guanjun:addEffect("targetmod", {
  name = "hx__guanjun",
  bypass_times = function(self, player, skill, scope, card)
    return card and player:getMark("@@hx__guanjun-turn") > 0
  end,
  bypass_distances = function(self, player, skill, card)
    return card and player:getMark("@@hx__guanjun-turn") > 0
  end,
})

return hx__guanjun